<template>
	<view class="news">
		<news-item @itemClick="goDetail" :list="newsList"></news-item>
	</view>
</template>

<script>
	import newsItem from '../../components/news-item/news-item.vue'
	export default {
		data() {
			return {
				newsList: []
			}
		},
		methods: {
			async getName() {
				const res = await this.$myRuquest({
					url: '/api/getnewsList'
				})
				this.newsList = res.data.message
			},
			goDetail(id) {
				uni.navigateTo({
					url: '/hm_shop/pages/news-detail/news-detail'
				})
			}
		},
		components: {
			"news_item": newsItem
		},
		onLoad() {
			this.getName()
		}
	}
</script>
.new{

}
<style>

</style>